# _*_ coding: utf-8 _*_
__author__ = 'yinlei'
__date__ = '2018-05-28 15:21'

from functools import wraps
import config
from flask import session,redirect,url_for

def login_required(func):
    @wraps(func)
    def check_login(*args,**kwargs):
        if config.FRONT_USER_ID not in session:
            return redirect(url_for('front.signin'))
        else:
            return func(*args,**kwargs)

    return check_login